<template>
  <div >
    <a-form-model class="fromModels" ref="privacyagreementModel" layout="vertical"  labelAlign="right"
    :labelCol="{span: 8}" :wrapperCol="{span: 16}">
        <a-form-model-item label="快捷手持开关" >
          <a-radio-group v-model="quicksystemFroms.quick_hand_status">
            <a-radio :value="0"> 关闭 </a-radio>
            <a-radio :value="1"> 开启 </a-radio>
          </a-radio-group>
        </a-form-model-item>
        <a-form-model-item label="快捷时间限制" >
          <div class="steps">
            <a-input-number  v-model="quicksystemFroms.first_use_time_limit"
            :min="1" :formatter="value => `${value}分钟`"
            :parser="value => value.replace('分钟', '')"
              />
          </div>
        </a-form-model-item>
        <a-form-model-item label="免认证日期" > 
          <a-date-picker v-model="quicksystemFroms.exempt_date" format="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss" />
        </a-form-model-item>
        <a-form-model-item  :wrapper-col="{ span: 21, offset:8 }">
          <a-button type="primary" @click="saveInfo">保存</a-button>
          <a-button style="margin: 0 10px;"  @click="resterInfor">重置</a-button>
          <a-button type="primary"  @click="saveInfo">同步品牌</a-button>
        </a-form-model-item>
    </a-form-model>
  </div>
</template>

<script>
import { writeConfigCommon,getConfigCommon } from '@/api/system.js'
export default {
  name: '',
  
  data() {
      return {
        quicksystemFroms:{
          quick_hand_status:0,
          first_use_time_limit:0,
          exempt_date:''
        }
      }
  },
  created(){
    this.getDataInfor()
  },
  methods:{
    resterInfor(){
      this.quicksystemFroms={
          quick_hand_status:0,
          first_use_time_limit:0,
          exempt_date:''
        }
    },
    saveInfo(){
      writeConfigCommon({
        brand_id: process.env.VUE_APP_BRAND_ID,scene:'sys_express_collection',...this.quicksystemFroms}).then(res=>{
        this.$message.success("操作成功");
      })
    },
    getDataInfor(){
      getConfigCommon({
        brand_id: process.env.VUE_APP_BRAND_ID,scene:'sys_express_collection'}).then(res=>{
        this.quicksystemFroms=res.data
      })
    }
  }
}
</script>

<style lang="less" scoped>
/deep/ .ant-form-vertical .ant-form-item-label{
  text-align: right;
  padding-right: 10px;
}
/deep/ .ant-form-vertical .ant-form-item-label::after{
  content: '：';
}
</style>
